<!DOCTYPE html>
<meta charset="utf-8" />

<link rel="stylesheet" href="ace_v1.3/assets/css/ui.jqgrid.css" />

<div class="search_panel">
<form action="mpamng/agent/queryProfitSharingPageCust.do" method="post" onsubmit="return pageSearch(this);">
	<div style="display: block;" class="widget-body ">
		<div class="widget-main">
			<div class="rowt">
				<div class="col-sm-12">
					<div>
						<div class="search_elm" style="margin-left: 0px;width: 300px;">
							<label class="label_search">合作商名称:</label>
							<div class="search_input">
<!-- 								<input id="search_agentName" type="text" name="agentName" placeholder="请输入合作商名称"> -->
								 <select 
									 rel="obj.options"
									 location="mpamng/selectoption/agentName.do" 
									 name="agentName" 
									 id="search_agentName" 
									 data-placeholder="请选择合作商名称" style="width: 200px;vertical-align:middle;">
									<option value='' >----请选择----</option>
								 </select>
							</div>
						</div>
						<div class="search_elm" style="margin-left: 0px;margin-right: 15px;width: 280px;">
						    <label class="label_search">分润计算日期:</label>
							<div class="input-group">
								<input type="text" class="form-control date-picker" name="startTime" placeholder="起始日期"  data-date-format="yyyy-mm-dd"/>
								<span class="input-group-addon">
									<i class="fa fa-exchange"></i>
								</span>
								<input type="text" class="form-control  date-picker" name="endTime" placeholder="结束日期" data-date-format="yyyy-mm-dd"/>
							</div>

							<!-- /section:plugins/date-time.datepicker -->
						</div>
						<div class="search_elm">
							<button class="btn btn-small btn_search" type="submit" title="搜索" > 搜索 </button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</form>
</div>
	<div class="rowt">
		<div class="col-xs-12">
			<table id="grid-table"></table>
			<div id="grid-pager"></div>
			<div style="margin-top: 10px">
				<span id="auth_btn">
<!-- 				<a class="btn btn-small btn-success" onclick="reportData();"> 导出数据文件</a> -->
				</span> <span id="paging_bar" style="float: right"> </span>
			</div>

		</div>
	</div>

	<script type="text/javascript">
		var jqGrid;
		jQuery(function($) {
			var grid_selector = "#grid-table";
			var pager_selector = "#grid-pager";

			$(window).on(
					'resize.jqGrid',
					function() {
						$(grid_selector).jqGrid('setGridWidth',$(".page-content").width());
					})
			var parent_column = $(grid_selector).closest('[class*="col-"]');
			$(document).on(
					'settings.ace.jqGrid',
					function(ev, event_name, collapsed) {
						if (event_name === 'sidebar_collapsed'|| event_name === 'main_container_fixed') {
							setTimeout(function() {
								$(grid_selector).jqGrid('setGridWidth',parent_column.width());
							}, 0);
						}
					})
			jQuery(grid_selector).jqGrid({
				url : "mpamng/agent/queryProfitSharingPageCust.do",
				datatype : "json",
				height : '100%',
				width : '100%',
				colNames : [ '交易日期','商户编号', '商户名称','合作商编号','合作商名称','合作商等级','交易笔数',"分润金额","交易金额","手续费","到帐金额"],
				colModel : [ {name : 'sharDate',		index : 'sharDate',			width : '150px',sortable:false},
				             {name : 'custId',			index : 'custId',			width : '150px',sortable:false}, 
				             {name : 'custName',    	index : 'custName',     	width : '150px' ,sortable:false},
				             {name : 'agentId',     	index : 'agentId',    		width : '150px' ,sortable:false },
				             {name : 'agentName',     	index : 'agentName',     	width : '150px' ,sortable:false},
			                 {name : 'agentDgr',     	index : 'agentDgr',     	width : '150px' ,sortable:false,ditcKey:'AGENTDGR' ,formatter : gridFormatByDict},
				             {name : 'payamtcount',     index : 'payamtcount',     	width : '150px' ,sortable:false},
				             {name : 'sharAmt',     	index : 'sharAmt',     		width : '150px' ,sortable:false,},
				             {name : 'cntOrdAmt',     	index : 'cntOrdAmt',     	width : '150px' ,sortable:false,},
				             {name : 'cntFee',     		index : 'cntFee',     		width : '150px' ,sortable:false,},
				             {name : 'cntNetrecAmt',    index : 'cntNetrecAmt',     width : '150px' ,sortable:false,},
				            ],
				viewrecords : true,
				rowNum : 10,
				rowList : [ 10, 20, 30 ],
				altRows : true,
				shrinkToFit:false,
				multiselect : true,//设置行可多选的 
				multiboxonly : true,//

				loadComplete : function() {
					var table = this;
					setTimeout(function() {
						//加载分页
						initPagingBar(grid_selector);
					}, 0);
				},
				beforeRequest : function() {//请求之前执行
					jqGrid = this;
				},
			});
			$(window).triggerHandler('resize.jqGrid');

			$(document).one('ajaxloadstart.page', function(e) {
				$(grid_selector).jqGrid('GridUnload');
				$('.ui-jqdialog').remove();
			});
		});
	</script>